package com.ian.controller;

import com.alibaba.fastjson.JSON;
import com.ian.entity.ConfigInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Witt
 * @version 1.0.0
 * @date 2022/7/21
 */
@RestController
public class ConfigInfoController {

    @Autowired
    private ConfigInfo configInfo;

    /**
     * 获取 application.yml文件中的 自定义配置属性值
     * @return JSON字符串 {"id":"100000002","ip":"192.168.1.11"}
     */
    @GetMapping("/configInfo")
    public String configInfo() {
        return JSON.toJSONString(configInfo);
    }
}
